<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
	<title></title>
	<style type="text/css">
		div{
		    width: 400px;
		    min-height: 100px;
		    max-height: 300px; //可以不设置
		     _height: 100px; //IE6
		    margin-left: auto;
		    margin-right: auto;
		    padding: 3px;
		    outline: 0;
		    border: 1px solid #a0b3d6;
		    font-size: 12px;
		    word-wrap: break-word; //允许换行
		    overflow-x: hidden;
		    overflow-y: auto; //超过最大高度就出现滚动条
		    _overflow-y: visible;
		}
	</style>
</head>
<body>
   <div contenteditable="true">
   	两个最主要的因素：1.contenteditable设置为true;2.给div设置最小高度。
   </div>
</body>
</html>